package com.share.ai.alibaba.starter.functions;


import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.context.annotation.Description;
import org.springframework.stereotype.Component;

import java.util.function.Function;

//.functions("timeFunction") //配置function
@Slf4j
@Component
public class StockFunction implements Function<String, Integer> {

    //告诉ai 遇到什么问题 就触发这个方法的调用(自动提取好参数)
    @Description("获取股票的涨幅信息")
    @Override
    public Integer apply(@ToolParam(description = "股票代码") String stockId) {
        log.info("----大模型调用了----");
        return 2;
    }
}